<?php
 
function write($file_name,$data,$mode='w'){
                     
    if(!in_array($mode,array('w','a','x')))
        return false;
 
    $dir = dirname($file_name);
 
    if(!is_dir($dir))
        $dir = mkdir($dir,0777);
         
    if(!$dir) return false;
 
    $file = fopen($file_name,$mode);
     
    if(!$file || !is_writable($file_name)) return false;
                 
    fwrite($file,$data);
    fclose($file);
     
    return true;
 
}
$content=file_get_contents("php://input");
//
if(!empty($content)){
write('xx.txt',$content);
}
$file_path = "xx.txt";
if(file_exists($file_path)){
$str = file_get_contents($file_path);//将整个文件内容读入到一个字符串中
$cons=explode("=", urldecode($str));
echo $cons[1];
}
?>